package cs3343.project.family;

import javax.swing.ImageIcon;
import java.util.LinkedList;


public class Character {
	int id;
	String name;
	char gender;
	String role;
	int mapAreaId;
	ImageIcon image;
	ImageIcon icon;
	int esteem;
	int totalEsteem;
	LinkedList<Card> cardsOwned = new LinkedList<Card>();
	
	//TODO: Remove unused Constructor
	// User for profile
	Character(int id, String name, char gender, String role, int totalEsteem) {
		this.id = id;
		this.name = name;
		this.gender = gender;
		this.role = role;
		this.totalEsteem = totalEsteem;
	}
	
	//real character constructor
	public Character(String name, char gender, int mapAreaId, ImageIcon image, ImageIcon icon, int esteem) {
		this.name = name;
		this.gender = gender;
		this.mapAreaId = mapAreaId;
		this.image = image;
		this.icon = icon;
		this.esteem = esteem;
	}
	
	
	// Useful
	public Character(String name, char gender, ImageIcon image, ImageIcon icon) {
		this.name = name;
		this.gender = gender;
		this.mapAreaId = 0;
		this.image = image;
		this.icon = icon;
		this.esteem = 0;
	}
	
	public String toString() {
		return id + "\t" + name + "\t" + gender + "\t" + role;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public char getGender() {
		return gender;
	}

	public void setGender(char gender) {
		this.gender = gender;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public int getMapAreaId() {
		return mapAreaId;
	}

	public void setMapAreaId(int mapAreaId) {
		this.mapAreaId = mapAreaId;
	}

	public ImageIcon getImage() {
		return image;
	}

	public void setImage(ImageIcon image) {
		this.image = image;
	}

	public ImageIcon getIcon() {
		return icon;
	}

	public void setIcon(ImageIcon icon) {
		this.icon = icon;
	}

	public int getEsteem() {
		return esteem;
	}

	public void setEsteem(int esteem) {
		this.esteem = esteem;
	}

	public int getTotalEsteem() {
		return totalEsteem;
	}

	public void setTotalEsteem(int totalEsteem) {
		this.totalEsteem = totalEsteem;
	}
	
	public void addCard(Card card) {
		if(cardsOwned.size() < 10)
			this.cardsOwned.add(card);
		else
			return; //TODO choose 1 to discard and replace
	}
	
	public void removeCard(Card card) {
		this.cardsOwned.remove(card);
	}
	
	public int getNoOfCardOwned() {
		return this.cardsOwned.size();
	}
	
	public LinkedList<Card> getCardsOwned() {
		return this.cardsOwned;
	}

	public void setCardsOwned(LinkedList<Card> cardsOwned) {
		this.cardsOwned = cardsOwned;
	}
}
